<template>
  <div>
    <el-card class="mt-20">
      <div class="flex f-between-center mb-20">
        <div>
          <el-tabs v-model="activeName" type="card">
            <el-tab-pane
              :label="item.label"
              :name="item.value"
              v-for="(item, index) in tabsList"
              :key="index"
            ></el-tab-pane>
          </el-tabs>
        </div>
        <div>
          <div class="reboter">
            <div class="sjke" style="margin-right: 10px; font-size: 12px">
              显示可邀约
            </div>
            <el-switch v-model="showIsAllConte"> </el-switch>
            <div class="s" style="margin-right: 10px"></div>
            <el-button
              type="primary"
              size="mini"
              :disabled="isLodinAllConter || (tableLoading && !loginAllDatas)"
              @click="cheacjer('getAllDarenShatsu')"
            >
              {{
                (tableLoading && !loginAllDatas && "加载中") ||
                (isLodinAllConter && `已加载${tableData.length}`) ||
                (loginAllDatas
                  ? `${tableData.length}/${pageObj.total} 点击停止加载`
                  : `继续加载剩余${pageObj.total - tableData.length}达人`)
              }}
            </el-button>
            <div>
              <el-tooltip
                class="item"
                effect="dark"
                :content="
                  !isBatchButtonDisabled
                    ? '当前列表中没有满足条件的达人，请加载更多达人信息。'
                    : isBatchButtonDisabled && multipleSelection.length > 0
                    ? '将勾选并且能够邀约的达人，自动添加到列表中'
                    : '请勾选需要邀约的达人'
                "
                placement="top-end"
              >
                <el-button
                  type="primary"
                  size="mini"
                  :disabled="
                    loginAllDatas ||
                    !isBatchButtonDisabled ||
                    !(isBatchButtonDisabled && multipleSelection.length > 0)
                  "
                  class="ml-30"
                  icon="el-icon-s-grid"
                  @click="cheacjer('showDrawer')"
                >
                  批量邀约
                </el-button>
              </el-tooltip>
            </div>
            <el-tooltip
              class="item"
              effect="dark"
              content="将勾选并且能够邀约的达人，自动添加到列表中"
              placement="top-end"
            >
              <img
                class="ml-10"
                src="@/assets/images/question-mark.png"
                style="width: 15px; height: 15px"
                alt=""
              />
            </el-tooltip>
            <!-- <template v-if="!isBatchButtonDisabled">
                            <div>
                                <el-tooltip class="item" effect="dark" content="当前列表中没有满足条件的达人，请切换下一页邀约。"
                                    placement="top-end">
                                    <el-button type="primary" size="mini" disabled class="ml-30" icon="el-icon-s-grid"
                                        @click="showDrawer()">
                                        批量邀约
                                    </el-button>
                                </el-tooltip>
                            </div>
                        </template>
<template v-else-if="isBatchButtonDisabled && multipleSelection.length > 0">
                            <div class="flex f--center">
                                <el-button type="primary" size="mini" class="ml-30" icon="el-icon-s-grid"
                                    @click="showDrawer()">
                                    批量邀约
                                </el-button>
                                <el-tooltip class="item" effect="dark" content="将勾选并且能够邀约的达人，自动添加到列表中"
                                    placement="top-end">
                                    <img class="ml-10" src="@/assets/images/question-mark.png"
                                        style="width: 15px; height: 15px" alt="" />
                                </el-tooltip>
                            </div>
                        </template>
<template v-else>
                            <div>
                                <el-tooltip class="item" effect="dark" content="请勾选需要邀约的达人" placement="top-end">
                                    <el-button type="primary" size="mini" disabled class="ml-30" icon="el-icon-s-grid">
                                        批量邀约
                                    </el-button>
                                </el-tooltip>
                            </div>
                        </template> -->
          </div>
        </div>
      </div>
      <el-table
        :data="getTabData"
        :row-key="getRowKey"
        style="width: 100%"
        ref="elTable"
        max-height="600"
        empty-text="未找到相关达人，请调整筛选内容~"
        v-loading="tableLoading"
        element-loading-text="加载数据中..."
        @sort-change="sortChange"
        @selection-change="handleSelectionChange"
        reserve-selection
        stripe
      >
        <el-table-column type="selection" reserve-selection width="55">
        </el-table-column>
        <el-table-column type="index" width="55"></el-table-column>
        <el-table-column
          :label="
            '达人信息' +
            `（预计可邀约${
              this.tableData.filter(
                (item) => item.author_connection.im_status == 1
              ).length
            }位）`
          "
          width="300"
        >
          <template slot-scope="{ row: { expertinfo, author_base } }">
            <div class="flex">
              <div class="flex f--center">
                <el-tooltip
                  class="item"
                  effect="dark"
                  content="点击前往达人主页"
                  placement="top"
                >
                  <img
                    class="profile-picture cursor-pointer"
                    :src="expertinfo.avatar"
                    alt=""
                    @click="jumpHomepage(author_base)"
                  />
                </el-tooltip>
              </div>
              <div class="ml-15">
                <div class="font-size-14">
                  <span class="mr-10">{{ expertinfo.nickname }}</span>
                  <span class="font-size-12"
                    >LV{{ expertinfo.author_level }}</span
                  >
                </div>
                <div class="font-size-12 color-898B8F">
                  <span
                    v-for="(item, index) in expertinfo.main_cate"
                    :key="index"
                    >{{ item
                    }}{{
                      index + 1 == expertinfo.main_cate.length ? "" : "/"
                    }}</span
                  >
                  <span class="ml-10">{{ expertinfo.city }}</span>
                </div>
                <div class="flex mt-10">
                  <span
                    v-if="expertinfo.high_response_rate"
                    class="mr-5 primary-tag"
                    >{{ expertinfo.high_response_rate }}
                  </span>
                  <template v-if="expertinfo.work_cate">
                    <span
                      class="tag"
                      v-for="(item, index) in expertinfo.work_cate"
                      :key="index"
                      >{{ item }}</span
                    >
                  </template>
                </div>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="粉丝数" sortable>
          <template slot-scope="{ row: { fans_num } }" v-if="fans_num">
            {{ commonNumFilter(fans_num) }}
          </template>
          <template v-else> - </template>
        </el-table-column>
        <template v-if="activeName == '1'">
          <el-table-column label="销售总额" sortable>
            <template
              slot-scope="{
                row: {
                  total_sales,
                  sale_info: {
                    total_sales: { sale_status },
                  },
                },
              }"
              v-if="!!total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    sale_status,
                    [
                      commonNumFilter(total_sales.sale_low),
                      commonNumFilter(total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="视频销售总额" sortable>
            <template
              slot-scope="{ row: { video_total_sales } }"
              v-if="!!video_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    video_total_sales.sale_status,
                    [
                      commonNumFilter(video_total_sales.sale_low),
                      commonNumFilter(video_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="直播销售总额" sortable>
            <template
              slot-scope="{ row: { live_total_sales } }"
              v-if="!!live_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    live_total_sales.sale_status,
                    [
                      commonNumFilter(live_total_sales.sale_low),
                      commonNumFilter(live_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="图文销售总额" sortable>
            <template
              slot-scope="{ row: { image_text_total_sales } }"
              v-if="!!image_text_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    image_text_total_sales.sale_status,
                    [
                      commonNumFilter(image_text_total_sales.sale_low),
                      commonNumFilter(image_text_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>

          <el-table-column label="橱窗销售总额" sortable>
            <template
              slot-scope="{ row: { window_total_sales } }"
              v-if="!!window_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    window_total_sales.sale_status,
                    [
                      commonNumFilter(window_total_sales.sale_low),
                      commonNumFilter(window_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
        </template>
        <!-- 视频达人字段 -->
        <template v-if="activeName == '3'">
          <el-table-column label="视频销售总额" sortable>
            <template
              slot-scope="{ row: { video_total_sales } }"
              v-if="!!video_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    video_total_sales.sale_status,
                    [
                      commonNumFilter(video_total_sales.sale_low),
                      commonNumFilter(video_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="单视频销售额" sortable>
            <template slot-scope="{ row: { video_sale } }" v-if="!!video_sale">
              <span>
                {{
                  stateReturnVal(
                    video_sale.video_sale_status,
                    [
                      commonNumFilter(video_sale.video_sale_low),
                      commonNumFilter(video_sale.video_sale_low),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="视频观看次数" sortable>
            <template slot-scope="{ row: { watching_times } }">
              <span v-if="watching_times != 0">
                {{ commonNumFilter(watching_times) }}
              </span>
              <span v-else> - </span>
            </template>
          </el-table-column>
          <el-table-column label="视频数">
            <template slot-scope="{ row: { all_video_num_30d } }">
              {{ all_video_num_30d }}
            </template>
          </el-table-column>

          <el-table-column label="视频GPM" sortable>
            <template slot-scope="{ row: { GPM } }" v-if="GPM">
              <span>
                {{
                  stateReturnVal(
                    GPM.GPM_status,
                    [GPM.GPM_low, GPM.GPM_high],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
        </template>
        <!-- 直播达人字段 -->
        <template v-if="activeName == '2'">
          <el-table-column label="直播销售总额" sortable>
            <template
              slot-scope="{ row: { live_total_sales } }"
              v-if="live_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    live_total_sales.sale_status,
                    [
                      commonNumFilter(live_total_sales.sale_low),
                      commonNumFilter(live_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="场均直播销售额" sortable>
            <template
              slot-scope="{ row: { field_average_sales } }"
              v-if="field_average_sales"
            >
              ¥{{ commonNumFilter(field_average_sales.sale_low) }}-{{
                commonNumFilter(field_average_sales.sale_high)
              }}
            </template>
          </el-table-column>
          <el-table-column label="直播观看次数" sortable>
            <template slot-scope="{ row: { watching_times } }">
              <span v-if="watching_times != 0">
                {{ commonNumFilter(watching_times) }}
              </span>
              <span v-else> - </span>
            </template>
          </el-table-column>
          <el-table-column label="直播场次">
            <template slot-scope="{ row: { all_live_num_30d } }">
              <span v-if="all_live_num_30d != 0">
                {{ all_live_num_30d }}
              </span>
              <span v-else> - </span>
            </template>
          </el-table-column>
          <el-table-column label="直播GPM" sortable>
            <template slot-scope="{ row: { GPM } }" v-if="GPM">
              <span>
                {{
                  stateReturnVal(
                    GPM.GPM_status,
                    [
                      commonNumFilter(GPM.GPM_low),
                      commonNumFilter(GPM.GPM_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
        </template>
        <!-- 图文达人 -->
        <template v-if="activeName == '4'">
          <el-table-column label="图文销售总额" sortable>
            <template
              slot-scope="{ row: { image_text_total_sales } }"
              v-if="image_text_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    image_text_total_sales.sale_status,
                    [
                      commonNumFilter(image_text_total_sales.sale_low),
                      commonNumFilter(image_text_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="单图文销售额" sortable>
            <template slot-scope="{ row: { singleVideo } }" v-if="singleVideo">
              <span>
                {{
                  stateReturnVal(
                    singleVideo.sale_status,
                    [
                      commonNumFilter(singleVideo.sale_low),
                      commonNumFilter(singleVideo.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="图文观看次数" sortable>
            <template slot-scope="{ row: { watching_times } }">
              <span v-if="watching_times != 0">
                {{ commonNumFilter(watching_times) }}
              </span>
              <span v-else> - </span>
            </template>
          </el-table-column>
          <el-table-column label="图文数">
            <template slot-scope="{ row: { image_text_num } }">
              <span v-if="image_text_num != 0">
                {{ commonNumFilter(image_text_num) }}
              </span>
              <span v-else> - </span>
            </template>
          </el-table-column>
          <el-table-column label="图文GPM" sortable>
            <template slot-scope="{ row: { GPM } }" v-if="GPM">
              <span>
                {{
                  stateReturnVal(
                    GPM.GPM_status,
                    [
                      commonNumFilter(GPM.GPM_low),
                      commonNumFilter(GPM.GPM_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
        </template>

        <template v-if="activeName == '5'">
          <el-table-column label="橱窗销售总额" sortable>
            <template
              slot-scope="{ row: { window_total_sales } }"
              v-if="window_total_sales"
            >
              <span>
                {{
                  stateReturnVal(
                    window_total_sales.sale_status,
                    [
                      commonNumFilter(window_total_sales.sale_low),
                      commonNumFilter(window_total_sales.sale_high),
                    ],
                    "money"
                  )
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="橱窗订单数" sortable>
            <template slot-scope="{ row: { order } }" v-if="order">
              <template v-if="order">
                <span>
                  {{
                    stateReturnVal(
                      order.status,
                      [
                        commonNumFilter(order.order_low),
                        commonNumFilter(order.order_high),
                      ],
                      "money"
                    )
                  }}
                </span>
              </template>
            </template>
            <span v-else>-</span>
          </el-table-column>

          <el-table-column label="橱窗出单商品数">
            <template slot-scope="{ row: { product_num } }">
              <span v-if="product_num">
                {{ commonNumFilter(product_num) }}
              </span>
              <span v-else>-</span>
            </template>
          </el-table-column>
        </template>

        <el-table-column label="邀约状态" width="150" fixed="right">
          <template slot-scope="{ row: { author_connection } }">
            <el-tag
              type="success"
              v-if="
                author_connection.im_status == 2 ||
                author_connection.im_status == 4
              "
              >已邀约</el-tag
            >
            <el-tag type="info" v-if="author_connection.im_status == 99"
              >无法邀约</el-tag
            >
            <el-tag type="" v-if="author_connection.im_status == 1"
              >未邀约</el-tag
            >
            <el-tag type="danger" v-if="author_connection.im_status == 3"
              >被拒绝</el-tag
            >
          </template>
        </el-table-column>

        <el-table-column label="操作" width="120" fixed="right">
          <template slot-scope="{ row = row, row: { author_connection } }">
            <el-popover placement="left-end" width="200" trigger="hover">
              <template v-if="![2, 4].includes(author_connection.im_status)">
                <span>
                  {{ author_connection.im_hover_text }}
                </span>
                <span
                  class="ml-10 cursor-pointer"
                  style="color: blue"
                  @click="openPage(author_connection.rule_link)"
                  >查看规则</span
                >
              </template>
              <span v-else> 前往官方平台进行沟通 </span>
              <el-button
                type="text"
                disabled
                v-if="author_connection.im_status == 99"
                slot="reference"
              >
                邀约带货</el-button
              >

              <el-button
                type="text"
                v-if="author_connection.im_status == 1"
                slot="reference"
                @click="cheacjer('showDrawer', row)"
              >
                邀约带货</el-button
              >
              <el-button
                type="text"
                v-if="author_connection.im_status == 3"
                slot="reference"
                disabled
              >
                拒绝邀约</el-button
              >
              <el-button
                style="color: #e6a23c"
                type="text"
                v-if="
                  author_connection.im_status == 2 ||
                  author_connection.im_status == 4
                "
                slot="reference"
                @click="
                  cheacjer(
                    'jumpPage',
                    'https://buyin.jinritemai.com/mpa/pigeonIM',
                    row
                  )
                "
              >
                继续沟通</el-button
              >
            </el-popover>
          </template>
        </el-table-column>
      </el-table>
      <div class="flex f--center mt-20">
        <el-pagination
          @current-change="handleCurrentChange"
          :current-page="pageObj.currentPage"
          :page-size="20"
          background
          layout="prev, pager, next,jumper"
          :total="tableDataLength"
        >
        </el-pagination>
      </div>
    </el-card>
  </div>
</template>

<script>
import { getIntelligentList, continueCommunicate } from "@/api/invitation";
import crossClass from "@/utils/cross-domain.js";
import { checkActivetity } from "@/utils/checkAll";

export default {
  props: ["params", "searchVal"],
  data() {
    return {
      tabsList: [
        {
          label: "全部达人",
          value: "1",
          name: "全部达人",
        },
        {
          label: "视频达人",
          name: "视频达人",
          value: "3",
        },
        {
          label: "直播达人",
          name: "直播达人",
          value: "2",
        },
        {
          label: "图文达人",
          name: "图文达人",
          value: "4",
        },
        {
          label: "橱窗达人",
          name: "橱窗达人",
          value: "5",
        },
      ],
      isBatchButtonDisabled: true,
      activeName: "1",
      tableData: [],
      query: null,
      sort: null,
      showPopover: false,
      pageObj: {
        currentPage: 1,
        total: 0,
      },
      tableLoading: true,
      filtersData: {},
      multipleSelection: [],
      getListPage: 1,
      loginAllDatas: false,
      stopLodinStatus: false,
      isLodinAllConter: false,
      isStartLodinAllConter: false,
      showIsAllConte: false,
      searchList: [], // 搜索条件有空格 换成数组处理
      originalQurey: "", // 原始的搜索框内容
    };
  },
  watch: {
    searchVal: {
      handler(newV) {
        this.originalQurey = JSON.parse(JSON.stringify(newV));
        this.query = JSON.parse(JSON.stringify(newV));
        this.resetTable();
      },
      deep: true,
    },
    activeName() {
      this.resetTable();
    },
    params: {
      handler(newV) {
        this.filtersData = JSON.parse(JSON.stringify(newV));
        this.resetTable();
      },
      deep: true,
    },
  },
  methods: {
    getRowKey(row) {
      // console.log("row", row);
      return row.author_base.uid;
    },
    recoyerOyer() {
      this.getListPage = 1;
      this.loginAllDatas = false;
      this.stopLodinStatus = false;
      this.isLodinAllConter = false;
      this.isStartLodinAllConter = false;
      this.showIsAllConte = false;
    },
    PollingInspect() {
      const fn = () => {
        let time = setInterval(() => {
          getIntelligentList(
            {
              page: this.pageObj.currentPage,
              filters: this.filtersData,
              refresh: true,
              search_id: "",
              type: Number(this.activeName),
            },
            {
              // verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
              // fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
              // msToken:
              //     'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
              // a_bogus:
              //     'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
            }
          )
            .then((res) => {
              let { code } = res;
              clearInterval(time);
              code == 0 && this.$router.go(0);
            })
            .catch((err) => {});
        }, 3000);
      };
      getIntelligentList(
        {
          page: this.pageObj.currentPage,
          filters: this.filtersData,
          refresh: true,
          search_id: "",
          type: Number(this.activeName),
        },
        {
          // verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
          // fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
          // msToken:
          //     'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
          // a_bogus:
          //     'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
        }
      )
        .then((res) => {
          let { code } = res;
          code == -2 && fn();
        })
        .catch((err) => {
          console.log(err, "err");
          fn();
        });
    },
    async jumpPage(url, row) {
      console.log("row", url, row);
      const crossInstance = new crossClass();
      const TipsFunc = (str, url) => {
        this.$confirm(str, "提示", {
          confirmButtonText: "前往打开",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            window.open(url);
          })
          .catch((err) => {})
          .finally(() => {
            setTimeout(() => {
              that.$router.go(0);
            }, 3000);
          });
      };
      let checkUrlOpen = await crossInstance.checkUrlOpen([
        "https://buyin.jinritemai.com/dashboard", //达人广场
        "https://fxg.jinritemai.com/ffa", // 抖店后台
      ]);
      let { code, data } = checkUrlOpen;
      if (code == 200) {
        let douDian = data.find((item) => {
          return (
            item.url == "https://fxg.jinritemai.com/ffa" && item.status == true
          );
        });
        let darenSquare = data.find((item) => {
          return (
            item.url == "https://buyin.jinritemai.com/dashboard" &&
            item.status == true
          );
        });
        if (!douDian) {
          let str = "使用该功能需要打开并登录抖店";
          let url = "https://fxg.jinritemai.com/login/common?from=buyin";
          TipsFunc(str, url);
          crossInstance.closeListen();
          return;
        }
        if (!darenSquare) {
          let str = "使用该功能需要打开并登录达人广场";
          let url =
            "https://buyin.jinritemai.com/dashboard/servicehall/daren-square?previous_page_name=3&previous_page_type=4";
          TipsFunc(str, url);
          crossInstance.closeListen();
          return;
        }
        crossInstance
          .sendMessageForPageFunc({
            id: darenSquare.id,
            script: `fetch('https://buyin.jinritemai.com/connection/pc/im/account?account_type=1&account_app_id=1128&account_id=${row.author_base.uid}',{
                            method: 'GET',
                            })
                            .then((res) => {
                            return res.json()
                            })
                            .then((res) => {
                            window.postMessage({
                                    type_urs: 'wkyy-wtbg',
                                    data: res,
                                    type_page: 'pageMeat',
                                    method: 'send_message_for_page'
                                })
                            })
                        `,
          })
          .then((res) => {
            console.log("res", res);
            const { code, data } = res;
            if (code == 200) {
              if (data.code == 0) {
                const getdfijer = data.data;
                let { buyin_account_id, im_id } = getdfijer;
                function splitJoint(obj) {
                  let arr = [];
                  for (let key in obj) {
                    arr.push(key + "=" + obj[key]);
                  }
                  return arr.length > 0 ? "?" + arr.join("&") : "";
                }
                let urlss =
                  "https://buyin.jinritemai.com/mpa/pigeonIM" +
                  splitJoint({
                    friendId: im_id,
                    buyinId: buyin_account_id,
                    pick_first_source: "达人直播主页",
                    previous_page_name: 3,
                    previous_page_type: 4,
                  });
                window.open(urlss);
              }
            }
          })
          .catch((err) => {
            window.open(url);
          });
      }
    },
    resetTable() {
      if (this.loginAllDatas || this.tableLoading) {
        return;
        // return this.$message.warning("正在请求， 不可重复操作");
      }
      this.recoyerOyer();
      this.pageObj.currentPage = 1;
      this.getListPage = 1;
      this.tableData = [];
      this.scrollTop();
      // 搜索条件多个处理
      this.query = JSON.parse(JSON.stringify(this.originalQurey));
      if (this.query) {
        // 判断搜索框有没有值 并且是否为多个用空格隔开
        this.searchList = this.query.split(" ");
        if (this.searchList.length > 1) {
          this.searchList.forEach((item, index) => {
            this.query = JSON.parse(JSON.stringify(item));
            this.getIntelligentListFunc();
            this.loginAllDatas = false;
          });
        } else {
          this.query = JSON.parse(JSON.stringify(this.query));
          this.getIntelligentListFunc();
        }
      } else {
        this.searchList = [];
        this.getIntelligentListFunc();
      }
    },
    // continueCommunicateFunc (row) {
    //     let {
    //         author_base: { uid }
    //     } = row
    //     continueCommunicate({
    //         account_id: uid,
    //         account_type: 1,
    //         account_app_id: 1128,
    //         verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
    //         fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
    //         msToken:
    //             'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
    //         a_bogus:
    //             'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
    //     })
    //         .then((res) => {
    //             console.log(res)
    //         })
    //         .catch((err) => { })
    // },
    sortChange(column) {
      let {
        order,
        column: { label },
      } = column;
      if (order) {
        order == "ascending" ? (order = 0) : (order = 1);
        let mappingArr = [
          {
            name: "粉丝数",
            return: () => {
              return {
                sort_field: 1,
                sort_type: order,
              };
            },
          },
          {
            name: "销售总额",
            return: () => {
              return {
                sort_field: 21,
                sort_type: order,
              };
            },
          },
          {
            name: "直播销售总额",
            return: () => {
              return {
                sort_field: 22,
                sort_type: order,
              };
            },
          },
          {
            name: "视频销售总额",
            return: () => {
              return {
                sort_field: 23,
                sort_type: order,
              };
            },
          },
          {
            name: "图文销售总额",
            return: () => {
              return {
                sort_field: 24,
                sort_type: order,
              };
            },
          },
          {
            name: "橱窗销售总额",
            return: () => {
              return {
                sort_field: 25,
                sort_type: order,
              };
            },
          },
          {
            name: "单视频销售总额",
            return: () => {
              return {
                sort_field: 18,
                sort_type: order,
              };
            },
          },
          {
            name: "视频观看次数",
            return: () => {
              return {
                sort_field: 19,
                sort_type: order,
              };
            },
          },
          {
            name: "场均直播销售额",
            return: () => {
              return {
                sort_field: 14,
                sort_type: order,
              };
            },
          },
          {
            name: "直播观看次数",
            return: () => {
              return {
                sort_field: 26,
                sort_type: order,
              };
            },
          },
          {
            name: "直播GPM",
            return: () => {
              return {
                sort_field: 17,
                sort_type: order,
              };
            },
          },

          {
            name: "单图文销售额",
            return: () => {
              return {
                sort_field: 27,
                sort_type: order,
              };
            },
          },

          {
            name: "图文观看次数",
            return: () => {
              return {
                sort_field: 28,
                sort_type: order,
              };
            },
          },
          {
            name: "图文GPM",
            return: () => {
              return {
                sort_field: 29,
                sort_type: order,
              };
            },
          },
          {
            name: "视频GPM",
            return: () => {
              return {
                sort_field: 20,
                sort_type: order,
              };
            },
          },

          {
            name: "橱窗订单数",
            return: () => {
              return {
                sort_field: 30,
                sort_type: order,
              };
            },
          },
        ];
        let sign = mappingArr.find((item) => item.name == label);
        if (sign) {
          this.sort = sign.return();
        }
      } else {
        this.sort = null;
      }
      this.scrollTop();
    },
    showDrawer(row, flag) {
      if (!row) {
        this.$emit(
          "showDrawerFunc",
          JSON.parse(JSON.stringify(this.multipleSelection))
        );
      } else {
        if (flag) {
          // 走搜索立即邀约
          this.$emit("showDrawerFunc", JSON.parse(JSON.stringify(row)));
        } else {
          // 走表格批量邀约
          this.$emit("showDrawerFunc", JSON.parse(JSON.stringify([row])));
        }
        // this.$emit("showDrawerFunc", JSON.parse(JSON.stringify([row])));
      }
    },
    stateReturnVal(status, value, type) {
      let [a, b] = value;
      if (status == 0) {
        let str;
        if (a == b) {
          str = a;
        } else if (a == 0) {
          str = b;
        } else if (b == 0) {
          str = a;
        } else {
          str = `${a}-${b}`;
        }
        if (type == "money") {
          str = "¥" + str;
        }
        return str;
      } else if (status == 1) {
        return "达人未授权";
      } else if (status == 2) {
        return "-";
      }
    },
    jumpHomepage(item) {
      function splitJoint(obj) {
        let arr = [];
        for (let key in obj) {
          arr.push(key + "=" + obj[key]);
        }
        return arr.length > 0 ? "?" + arr.join("&") : "";
      }
      let { uid } = item;
      let params = {
        enter_from: "1",
        previous_page_name: "3,5",
        previous_page_type: "4,100",
        log_id: "20240802180735D2CC7FEA944F8218FD25",
        search_id: "",
        btm_ppre: "a0.b0.c0.d0",
        btm_pre: "a52248.b31023.c473806.d0",
        btm_show_id: "9f4ceca0-99ae-4fa5-bef7-b23ca4152fa8",
        uid,
      };
      let url =
        "https://buyin.jinritemai.com/dashboard/servicehall/daren-profile" +
        splitJoint(params);
      window.open(url);
    },
    openPage(url) {
      window.open(url);
    },
    scrollTop() {
      this.$refs.elTable.bodyWrapper.scrollTop = 0;
    },
    handleCurrentChange(val) {
      this.pageObj.currentPage = val;
      this.scrollTop();
    },
    handleSelectionChange(e) {
      // console.log('eelectshebr0.132456', e)
      this.multipleSelection = e;
    },
    commonNumFilter(num) {
      if (num == 0) {
        return num;
      } else if (Number(num) < 10000) {
        return num;
      } else {
        return (Number(num) / 10000).toFixed(2) + "万";
      }
    },
    getFormager(list) {
      // console.log('list', list)
      return list.map((item) => {
        let {
          author_base: { nickname, avatar, author_level, fans_num, city },
          author_tag: { main_cate, high_response_rate, work_cate },
          author_video: {
            watching_times,
            all_video_num_30d,
            GPM_low,
            GPM_high,
            GPM_status,
            video_sale_low,
            video_sale_high,
            video_sale_status,
          },
          sale_info: {
            total_sales,
            video_total_sales,
            live_total_sales,
            image_text_total_sales,
            window_total_sales,
          },
          author_live,
          author_image_text,
          author_window,
          latest_content,
        } = item;
        let typeParams;
        let obj = {
          ["3"]: () => {
            typeParams = {
              watching_times, //视频观看次数
              all_video_num_30d, //视频数
              GPM: {
                GPM_low,
                GPM_high,
                GPM_status,
              }, //视频GPM
              video_sale: {
                video_sale_low,
                video_sale_high,
                video_sale_status,
              }, //单视频销售额
              video_total_sales, //视频销售总额
              latest_content,
            };
          },
          ["1"]: () => {
            typeParams = {
              total_sales, //总销售额
              video_total_sales, //视频销售额
              live_total_sales, //直播销售额
              image_text_total_sales, //图文销售额
              window_total_sales, //橱窗销售额
            };
          },
          ["2"]: () => {
            typeParams = {
              GPM: {
                //直播GPM
                GPM_high: author_live.GPM_high,
                GPM_low: author_live.GPM_low,
                GPM_status: author_live.GPM_status,
              },
              live_total_sales, //直播销售额
              field_average_sales: {
                //场均直播销售额
                sale_high: author_live.sale_high,
                sale_low: author_live.sale_low,
              },
              watching_times: author_live.watching_times, // 直播观看次数
              all_live_num_30d: author_live.all_live_num_30d, //直播场次
            };
          },
          ["4"]: () => {
            let {
              GPM_high,
              GPM_low,
              GPM_status,
              watching_times,
              image_text_num,
            } = author_image_text;
            typeParams = {
              image_text_total_sales: {
                //图文销售总额
                sale_low: image_text_total_sales.sale_low,
                sale_high: image_text_total_sales.sale_high,
                sale_status: image_text_total_sales.sale_status,
              },
              image_text_num, //图文数
              GPM: {
                GPM_high,
                GPM_low,
                GPM_status,
              }, //GPM
              watching_times, //图文观看次数
              singleVideo: {
                sale_high: author_image_text.sale_high,
                sale_low: author_image_text.sale_low,
                sale_status: author_image_text.sale_status,
              }, //单图文销售额
              latest_content,
            };
          },
          ["5"]: () => {
            let author_windowObj = {};
            if (item.author_window) {
              let { order_low, order_high, product_num, status } =
                author_window;
              author_windowObj = {
                order: {
                  order_low,
                  order_high,
                  status,
                }, //橱窗订单数
                product_num, //橱窗出单数
              };
            }
            typeParams = {
              window_total_sales: {
                //橱窗销售总额
                sale_low: window_total_sales.sale_low,
                sale_high: window_total_sales.sale_high,
                sale_status: window_total_sales.sale_status,
              },
              ...author_windowObj,
            };
          },
        };
        obj[this.activeName] && obj[this.activeName]();
        return {
          ...item,
          expertinfo: {
            nickname,
            avatar,
            author_level,
            main_cate,
            high_response_rate,
            city,
            work_cate,
          },
          fans_num, //粉丝数
          ...typeParams,
        };
      });
    },
    sortFunc(list) {
      list = list.sort((a) => {
        return a.author_connection.im_status == 3 ? -1 : 1;
      });
      list = list.sort((a) => {
        return [2, 4].includes(a.author_connection.im_status) ? -1 : 1;
      });
      list = list.sort((a) => {
        return a.author_connection.im_status == 1 ? -1 : 1;
      });
      return list;
    },
    async getIntelligentListFunc(getAll, allTow) {
      if (
        (getAll || this.getListPage === 1) &&
        !allTow &&
        !this.getAllDarenShatsu
      ) {
        this.getListPage = 1;
        // this.tableData = []
      }
      const _this = this;
      async function getAllPagingData(obj, params, currentPage) {
        if (obj.page == 1) {
          _this.$refs.elTable && _this.$refs.elTable.clearSelection();
          obj.refresh = true;
        } else {
          obj.refresh = false;
        }
        let totalData = await getIntelligentList(obj, params).then((res) => {
          let { data, code } = res;
          if (code == 0 && data) {
            return res;
          }
        });

        return totalData;
      }
      this.tableLoading = true;
      let obj = {
        page: this.getListPage,
        filters: this.filtersData,
        refresh: true,
        search_id: "",
        type: Number(this.activeName),
        query: "",
      };
      if (this.query) {
        obj.query = this.query;
      }
      if (this.sort) {
        obj = {
          ...obj,
          ...this.sort,
        };
      }
      //   if (getAll) {
      //     // 批量获取全部
      //     // console.log('获取全部的赶火车')

      //     // this.getAllInNewPages(obj)
      //     // return
      //     const lieyr = await getAllPagingData(obj, {}, this.pageObj.currentPage)
      //     if (lieyr.code == 0) {
      //       const { data } = lieyr
      //       const { list, total } = data
      //       this.pageObj.total = total
      //       const getProMiae = []

      //       function treiyrr(i) {
      //         console.log('insyerinsyerinsyer', i)
      //         return new Promise((resolve) => {
      //           setTimeout(() => {
      //             resolve(getAllPagingData(obj, {}))
      //           }, i * 200)
      //         })
      //       }
      //       let insyer = 0
      //       while (obj.page * 20 < total) {
      //         obj.page++
      //         insyer++
      //         getProMiae.push(treiyrr(insyer))
      //       }
      //       let listAlls = list

      //       Promise.all(getProMiae).then((res) => {
      //         // console.log('res++614', res)
      //         res.forEach((items) => {
      //           if (items.code === 0) {
      //             listAlls.push(...items.data.list)
      //           }
      //         })
      //         listAlls = listAlls.filter(
      //           (item, index) =>
      //             listAlls.findIndex(
      //               (i) => i.author_base.aweme_id === item.author_base.aweme_id
      //             ) === index
      //         )

      //         let forMaterList = this.getFormager(listAlls)
      //         this.tableData = forMaterList
      //         this.tableData = this.sortFunc(this.tableData)
      //         this.isBatchButtonDisabled = !this.tableData.every(
      //           (item) => item.author_connection.im_status != 1
      //         )
      //         this.$refs.elTable.toggleAllSelection()
      //         // console.log('resd', listAlls)

      //         this.loginAllDatas = false
      //         this.stopLodinStatus = false
      //         this.tableLoading = false

      //         this.isLodinAllConter = true
      //         this.isStartLodinAllConter = false
      //       })
      //     }

      //     return
      //   }

      getAllPagingData(
        obj,
        {
          // verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
          // fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
          // msToken:
          //     'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
          // a_bogus:
          //     'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
        },
        this.pageObj.currentPage
      )
        .then((res) => {
          try {
            let {
              data: { list, total },
              code,
            } = res;
            if (code == 0) {
              this.pageObj.total = total;
              list = list.filter(
                (item, index) =>
                  list.findIndex(
                    (i) => i.author_base.aweme_id === item.author_base.aweme_id
                  ) === index
              );
              if (list && list.length > 0) {
                let forMaterList = this.getFormager(list);
                // this.multipleSelection = this.handleSelectionChange(
                //   //   forMaterList.map((item) => {
                //   //     return item.author_base.uid
                //   //   })
                //   forMaterList
                // )
                // 判断输入框数据是否为多个字段用空格隔开 且取查到的数据前3条
                if (this.searchList.length > 1) {
                  this.tableData.push(...forMaterList.slice(0, 3));
                  this.isLodinAllConter = true;
                  // this.loginAllDatas = true
                  // this.tableLoading = false;
                } else {
                  if (this.tableData.length) {
                    this.tableData.push(...forMaterList);
                  } else {
                    this.tableData = forMaterList;
                  }
                }

                this.tableData = this.sortFunc(this.tableData);
                this.isBatchButtonDisabled = !this.tableData.every(
                  (item) => item.author_connection.im_status != 1
                );
                this.$refs.elTable.toggleAllSelection();

                // console.log('total', total)
                // this.$refs.elTable.toggleRowSelection(this.tableData[0])
                // this.multipleSelection = this.tableData
                if (getAll && this.getListPage * 20 < total) {
                  this.getListPage++;
                  //   console.log('qingq ', this.getListPage)
                  if (getAll && allTow && this.stopLodinStatus) {
                    this.loginAllDatas = false;
                    this.stopLodinStatus = false;
                    this.tableLoading = false;
                    return;
                  }
                  this.getIntelligentListFunc(true, true);
                } else {
                  this.loginAllDatas = false;
                  this.stopLodinStatus = false;
                  this.tableLoading = false;
                  // this.isLodinAllConter = true
                }
                if (this.getListPage * 20 >= total) {
                  this.isLodinAllConter = true;
                  this.isStartLodinAllConter = false;
                }
              } else {
                this.tableData = [];
              }
            }
            // this.tableLoading = false;
          } catch (error) {
            // console.log(error)
          }
        })
        .catch((e) => {
          this.$message({
            type: "warning",
            message: "该商家未入驻精选联盟,请先入驻精选联盟",
          });
          this.tableLoading = false;
        });
    },
    async getAllInNewPages(obj) {
      const crossInstance = new crossClass();
      const TipsFunc = (str, url) => {
        this.$confirm(str, "提示", {
          confirmButtonText: "前往打开",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            window.open(url);
          })
          .catch((err) => {})
          .finally(() => {
            setTimeout(() => {
              that.$router.go(0);
            }, 3000);
          });
      };
      let checkUrlOpen = await crossInstance.checkUrlOpen([
        "https://buyin.jinritemai.com/dashboard", //达人广场
        "https://fxg.jinritemai.com/ffa", // 抖店后台
      ]);
      let { code, data } = checkUrlOpen;
      if (code == 200) {
        let douDian = data.find((item) => {
          return (
            item.url == "https://fxg.jinritemai.com/ffa" && item.status == true
          );
        });
        let darenSquare = data.find((item) => {
          return (
            item.url == "https://buyin.jinritemai.com/dashboard" &&
            item.status == true
          );
        });
        if (!douDian) {
          let str = "使用该功能需要打开并登录抖店";
          let url = "https://fxg.jinritemai.com/login/common?from=buyin";
          TipsFunc(str, url);
          crossInstance.closeListen();
          return;
        }
        if (!darenSquare) {
          let str = "使用该功能需要打开并登录达人广场";
          let url =
            "https://buyin.jinritemai.com/dashboard/servicehall/daren-square?previous_page_name=3&previous_page_type=4";
          TipsFunc(str, url);
          crossInstance.closeListen();
          return;
        }
        // ;(function () {
        //   let addputer = []
        //   fetch(
        //     'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
        //     {
        //       method: 'POST',
        //       headers: {
        //         'Content-Type': 'application/json',
        //       },
        //       body: JSON.stringify(obj),
        //     }
        //   )
        //     .then((res) => {
        //       return res.json()
        //     })
        //     .then((res) => {
        //       const { code, data } = res
        //       if (!res.code) {
        //         const { total } = data
        //         console.log('total', total)
        //         data.page = 1
        //         while (obj.page * 20 < total) {
        //           data.page++
        //           addputer.push(
        //             fetch(
        //               'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
        //               {
        //                 method: 'POST',
        //                 headers: {
        //                   'Content-Type': 'application/json',
        //                 },
        //                 body: JSON.stringify(obj),
        //               }
        //             ).then((res) => {
        //               return res.json()
        //             })
        //           )

        //           // getProMiae.push(getAllPagingData(obj, {}, this.pageObj.currentPage))
        //         }

        //         Promise.all(addputer).then((res) => {
        //           window.postMessage({
        //             type_urs: 'wkyy-wtbg',
        //             data: res,
        //             type_page: 'pageMeat',
        //             method: 'send_message_for_page',
        //           })
        //         })
        //       }
        //     })
        // })()
        // console.log('obj', JSON.stringify(obj))
        crossInstance
          .sendMessageForPageFunc({
            id: darenSquare.id,
            script: `;(function (datas) {
            let addputer = []
            console.log('data1234568798', datas)
            fetch(
                'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
                {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                },
                body: JSON.stringify(datas),
                }
            )
            .then((res) => {
              return res.json()
            })
            .then((res) => {
                const { code, data } = res
              if (!res.code) {
                const { total } = data
                console.log('total', total)
                datas.page = 1
                while (datas.page * 20 < total) {
                  datas.page++
                  addputer.push(
                    fetch(
                      'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
                      {
                        method: 'POST',
                        headers: {
                          'Content-Type': 'application/json',
                        },
                        body: JSON.stringify(datas),
                      }
                    ).then((res) => {
                      return res.json()
                    })
                  )

                  // getProMiae.push(getAllPagingData(obj, {}, this.pageObj.currentPage))
                }

                Promise.all(addputer).then((res) => {
                  window.postMessage({
                    type_urs: 'wkyy-wtbg',
                    data: res,
                    type_page: 'pageMeat',
                    method: 'send_message_for_page',
                  })
                })
              }
            })
          })(${JSON.stringify(obj)})
                        `,
          })
          .then((res) => {
            // console.log('res65498756465465', res)
          })
          .catch((err) => {
            window.open(url);
          });
      }
    },
    cheacjer(func, ...a) {
      // 先检查登录状态
      // 登录完成后立马检查激活状态
      if (!this.$store.state.yywk.yywktoken) {
        console.log("先登录");
        this.$emit("showLoginBox");
        return;
      }

      const acstatus = checkActivetity();
      if (!acstatus) {
        // console.log('调用激活123456')
        // this.$emit('showLoginBox')

        this.$emit("showActivetBox");

        return;
      }
      // console.log('arguments', a)
      // this[func]
      this[func](...a);
    },

    getAllDarenShatsu() {
      //   return
      if (!this.isStartLodinAllConter) {
        this.getListPage = 1;
        this.tableData = [];
      }
      this.isStartLodinAllConter = true;
      if (!this.loginAllDatas) {
        this.getIntelligentListFunc(true);
        this.loginAllDatas = true;
      } else {
        this.stopLodinStatus = true;
      }
    },
    refoLisuehr() {
      this.loginAllDatas = false;
      this.stopLodinStatus = false;
      this.isLodinAllConter = false;
      this.isStartLodinAllConter = false;
      this.showIsAllConte = false;
      this.getListPage = 1;
      this.tableData = [];
      this.getIntelligentListFunc();
    },
  },
  computed: {
    getTabData() {
      //   this.$refs.elTable && this.$refs.elTable.toggleAllSelection()
      // 返回tableData 第 pageObj.currentPage 页的 20条
      let reloads = this.showIsAllConte
        ? this.tableData.filter((item) => item.author_connection.im_status == 1)
        : this.tableData; // .slice((this.pageObj.currentPage - 1) * 20, this.pageObj.currentPage * 20)

      return reloads.slice(
        (this.pageObj.currentPage - 1) * 20,
        this.pageObj.currentPage * 20
      );
      //   return this.showIsAllConte
      //     ? this.tableData.filter((item) => item.author_connection.im_status == 1)
      //     : this.tableData // .slice((this.pageObj.currentPage - 1) * 20, this.pageObj.currentPage * 20)
    },
    tableDataLength() {
      return this.showIsAllConte
        ? this.tableData.filter((item) => item.author_connection.im_status == 1)
            .length
        : this.tableData.length;
    },
  },

  mounted() {
    setTimeout(() => {
      this.refoLisuehr();
      this.PollingInspect();
    }, 2000);
  },
};
</script>

<style scoped>
.reboter {
  display: flex;
  align-items: center;
}

.el-tabs__header {
  margin: 0;
}

.el-table__body-wrapper .is-scrolling-none {
  height: 540px;
}

.profile-picture {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.primary-tag {
  background-color: transparent;
  color: rgb(25, 102, 255);
  border: 1px solid rgba(25, 102, 255, 0.12);
  line-height: 14px;
  padding: 3px;
}

.tag {
  background-color: transparent;
  color: rgb(105, 113, 140);
  border: 1px solid rgb(232, 232, 233);
  line-height: 14px;
  padding: 3px;
}
</style>
